<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>MMV-后台</title>
    <link rel="icon" href="material/tank1.png">
    <style>
        body,html{
            padding: 0;
            margin: 0;
            border: 0;
            background-color: #98E800;
        }
        .box{
            width:26vw;
            height:24vh;
            box-shadow: #0008 0 0 8px 8px;
            border-radius: 8px;
            margin-left: 37vw;
            margin-top: 30vh;
            background-color: #fff;
        }
        .box p{
            font-size: 3.5vh;
            line-height: 8vh;
            width: 100%;
            height:8vh;
            margin: 0;
            text-align: center;
        }
        .box input{
            width:calc( 18vw - 6px );
            height:3vh;
            border-radius: 8px;
            outline: 0;
            border-color: #ddd;
            border-width: 1px;
            border-style: solid;
            padding: 2px;
            text-align: center;
            margin-left:4vw;
            margin-top: 2vh;
            font-size: 2vh;
        }
        .box button{
            width:18vw;
            height:3.5vh;
            border-radius: 8px;
            outline: 0;
            background-color: #50A000;
            border: 0;
            margin-left:4vw;
            margin-top: 2vh;
            color:#fff;
            font-size: 2vh;
        }
        .box button:active{
            background-color: #2e6000;
        }
    </style>
</head>
<body>
    <div class="box">
        <p>重装机兵-V版 后台</p>
        <input id="password" placeholder="请输入密码" type="password">
        <button onclick="login()">登&emsp;&emsp;陆</button>
    </div>
</body>
<script src="js/http.js"></script>
<script>
    function login(){
        let pa=document.getElementById("password").value;
        if(pa.length<=0){
            alert("请输入密码");
            return;
        }
        fetch(server_url+http_host.login,{
            method:"POST",
            headers:{"Content-Type":"application/json"},
            body:JSON.stringify({
                password:pa
            })
        }).then(da=>{return da.json()}).then(da=>{
            if(da.status){
                window.sessionStorage.setItem("code",da.verifyCode);
                window.location.href="/html/master";
            }else{
                alert(da.tip);
            }
        });
    }
</script>
</html>